package com.wordsbank.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 启动跨域配置
 * 使用FilterConfig中的配置
 */

@SpringBootConfiguration
public class WebMVCConfig implements WebMvcConfigurer {

    @Autowired
    private FilterConfig filterConfig;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(filterConfig).addPathPatterns("/**");
    }
}
